Enumeration
The enumerated type Declaration defines a type name for a group of related symbol constants. Enumeration is used for "Multiple Choices", that isProgramThe runtime is determined by the fixed number of "Choices" that have been set at the
[Reading Notes] C # Chapter 2 core C #,
(1) The first C # Program
Create a console application, enter the code, and then click F5.
Console. WriteLine (); the meaning of this statement: output the content in the brackets to the interface;
Console.
Unique strength of enumeration, unique strength of enumeration
Enumeration
The enumerated type Declaration defines a type name for a group of related symbol constants. Enumeration is used for "Multiple Choices", that is, when the program is running,
The members in the structure can be assigned values. What about enumeration... is a value, read-onlyYou can create a class as a structure in the following situations:(1) If there are very few fields in a class, the total memory occupied by all
EnumerationAn enumeration type declaration defines a type name for a set of related symbolic constants. Enumeration is used for "multiple selection" scenarios where the program runs from a fixed number of "choices" that have been set at compile time.
Note: This article is intended for those who are not familiar with C # or who want to learn more about C #. If you are a technical expert, Please bypass it to avoid delay in your valuable time.
To use C #, first understand the knowledge: declare
What do you think?
The answer is this.
S1 is A string
S2 is A string
S1 is now anothing string
S2 is now string
How do you feel when you see the result? I was very surprised. Because the way the string was implemented according to the original C,
1. You can use the csc.exe compiler to compile the source file.
The most convenient way is to start running-> Program-> VS Tools-> VS command promptRun in the directory:Csc fileName. cs
Or, after the corresponding environment variables are
1. enumeration concept: enumeration is a user-defined Integer type. When declaring an enumeration, you must specify a group of acceptable values that can be included in the enumeration instance, you can also specify a name that is easy to remember.
C # convert enum to string for Enumeration type conversion
All enumeration types are value types.
System. enum is an abstract class. All enumeration types inherit from it directly, and of course all its members.
All value types are system. the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.